package siau.android.base

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import hhm.android.base.adapter.HBaseAdapter
import hhm.android.library.utils.OnMultiClickListener
import siau.android.http.model.ChildModel
import siau.android.http.model.ShoeSizeListModel

class BottomShoeSizeClassSelectAdapter(var context: Context, list: ArrayList<ShoeSizeListModel>, var listener: OnMultiClickListener) : HBaseAdapter<BottomSingleBabySelectViewHolder, ShoeSizeListModel>(list) {
    override fun bindData(holder: BottomSingleBabySelectViewHolder, bean: ShoeSizeListModel, position: Int) {
        if (bean.select) {
            holder.tv.text = bean.typeName
            holder.iv.setImageResource(R.drawable.ring_main_5)
        } else {
            holder.tv.text = bean.typeName
            holder.iv.setImageResource(R.drawable.ring_ca_1)
        }
        holder.itemView.setOnClickListener {
            it.tag = position
            listener.onMultiClick(it)
        }
    }

    override fun bindView(parent: ViewGroup, viewType: Int): BottomSingleBabySelectViewHolder {
        val v = LayoutInflater.from(parent.context).inflate(R.layout.item_bottom_select_baby_item, parent, false)
        return BottomSingleBabySelectViewHolder(v)
    }

}